package net.koodar.forge.system.role.model.dto;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.Getter;
import lombok.Setter;
import net.koodar.forge.mybatis.doman.page.AbstractPageQuery;
import net.koodar.forge.system.role.model.entity.Role;

/**
 * @author liyc
 */
@Getter
@Setter
public class RoleQueryDTO extends AbstractPageQuery<Role> {

	private String roleName;

	@Override
	public QueryWrapper<Role> addQueryCondition() {
		QueryWrapper<Role> queryWrapper = Wrappers.query();
		queryWrapper.eq(StrUtil.isNotBlank(roleName), "role_name", roleName);
		return queryWrapper;
	}
}
